import buyManager
import productManager
import sellManager

import comboRuleSpecEditor
import inputRuleSpecEditor
import fromToRuleSpecEditor
import yearMonthRuleSpecEditor

def drawForm(parent, type):
    if type == "Provider":
       providers = buyManager.get_providers()
       editor = comboRuleSpecEditor.Dialog1(parent, type, [x.name for x in providers])         
    elif type == "Group":
       groups = productManager.get_groups()
       editor = comboRuleSpecEditor.Dialog1(parent, type, [x.name for x in groups])
    elif type == "AmountItem":
        editor = fromToRuleSpecEditor.Dialog1(parent, type)
    elif type == "AmountMoney":
        editor = fromToRuleSpecEditor.Dialog1(parent, type)
    elif type == "PayType":
        valores = sellManager.get_valores()
        editor = comboRuleSpecEditor.Dialog1(parent, type, [x.nombre for x in valores])
    elif type == "Codsussan":
        editor = inputRuleSpecEditor.Dialog1(parent, type)
    elif type == "YearMonth":
        editor = yearMonthRuleSpecEditor.Dialog1(parent, type)
    #elif type == "PTC":
    #    editor = inputRuleSpecEditor.Dialog1(parent, type)
        
    return editor